package org.zgr.service.record;

import org.zgr.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import common.entity.rank.GoodsHotWithMonth;
import org.zgr.mapper.RecordGoodHotWithMonthMapper;

/**
 * @Author: 郑国荣
 * @Date: 2024-04-07-16:10
 * @Description:
 */
@Service
public class RecordGoodHotWithMonth {
    @Autowired
    private RecordGoodHotWithMonthMapper recordGoodHotWithMonthMapper;

    @Autowired
    public RedisService redisService;

    public GoodsHotWithMonth getHotGoodsWithMonthById(){
        return recordGoodHotWithMonthMapper.selectById(1);
    }

    public boolean createRedisSortSet(String goods_id, int score){
        System.out.println("createRedisSortSet");
        // 创建一个redis有序集合
        return redisService.addOneIfAbsent(goods_id, 1.00);
    }

}
